//
//  UIDevice+SwitchOrientation.m
//  yuanxinwebview
//
//  Created by GJS on 2019/12/27.
//  Copyright © 2019 晏德智. All rights reserved.
//

#import "UIDevice+SwitchOrientation.h"


@implementation UIDevice (SwitchOrientation)

+ (void)switchNewOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    NSNumber *resetOrientationTarget = [NSNumber numberWithInt:UIInterfaceOrientationUnknown];
    [[UIDevice currentDevice] setValue:resetOrientationTarget forKey:@"orientation"];
    NSNumber *orientationTarget = [NSNumber numberWithInt:interfaceOrientation];
    [[UIDevice currentDevice] setValue:orientationTarget forKey:@"orientation"];
}

@end
